#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define LL long long
const int INF = 0x3f3f3f3f;

int n, k;
struct node {
  int a, b;
  double p;
} x[1009];

bool cmp(node a, node b) { return a.p > b.p; }

bool check(double xx) {
  for (int i = 1; i <= n; i++) x[i].p = 1.0 * x[i].a - 1.0 * x[i].b * xx;
  sort(x + 1, x + 1 + n, cmp);
  double sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n - k; i++) sum1 += x[i].a, sum2 += x[i].b;
  return sum1 / sum2 > xx;
}

int main() {
  while (~scanf("%d%d", &n, &k)) {
    if (!n && !k) break;
    for (int i = 1; i <= n; i++) scanf("%d", &x[i].a);
    for (int i = 1; i <= n; i++) scanf("%d", &x[i].b);
    double l = 0, r = 1;
    while (fabs(r - l) > 1e-8) {
      double mid = (l + r) / 2;
      if (check(mid))
        l = mid;
      else
        r = mid;
    }
    printf("%.0f\n", l * 100);
  }
  return 0;
}
